package com.java;

/**
 * 利用反射和泛型获取任意类的实例对象
 */
public class ReflectionGeneric {
    public static <T> T getInstance(Class<T> cls) throws InstantiationException, IllegalAccessException {
        return cls.newInstance();
    }

    public static void main(String[] args) throws InstantiationException, IllegalAccessException {
        getInstance(ReflectionGeneric.class);
    }
}
